package com.pc.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pc.enrty.Food;
import com.pc.mapper.FoodMapper;
import com.pc.service.FoodService;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
@Service
public class FoodServiceImpl implements FoodService {
    @Autowired
    private FoodMapper foodMapper;

    @Override
    public PageInfo<Food> findByIdCidAndName(Food food, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        //执行查询
        ArrayList<Food> foods=foodMapper.selectByIdCidAndName(food);
        //返回分页信息
        return new PageInfo<>(foods);
    }

}
